import { S } from '../../s';
import { IPSDEUILogic } from './ipsdeuilogic';
import { IPSDEUILogicParam } from './ipsdeuilogic-param';
import { IPSDEUIMsgBoxLogic } from './ipsdeuimsg-box-logic';
import { PSDEUILogicNodeImpl } from './psdeuilogic-node-impl';

export class PSDEUIMsgBoxLogicImpl
  extends PSDEUILogicNodeImpl
  implements IPSDEUIMsgBoxLogic
{
  get buttonsType(): 'YESNO' | 'YESNOCANCEL' | 'OK' | 'OKCANCEL' {
    return this.M.buttonsType;
  }

  protected dstpsdeuilogicparam: IPSDEUILogicParam;
  getDstPSDEUILogicParam(): IPSDEUILogicParam | null {
    if (this.dstpsdeuilogicparam != null) return this.dstpsdeuilogicparam;
    const value = this.M.getDstPSDEUILogicParam;
    if (value == null) {
      return;
    }
    const ipsdeuilogic = this.getParentPSModelObject(S._206) as IPSDEUILogic;
    if (ipsdeuilogic != null) {
      this.dstpsdeuilogicparam = ipsdeuilogic.findPSDEUILogicParam(value);
    }
    return this.dstpsdeuilogicparam;
  }

  get message(): string {
    return this.M.message;
  }

  protected msgboxparam: IPSDEUILogicParam;
  getMsgBoxParam(): IPSDEUILogicParam | null {
    if (this.msgboxparam != null) return this.msgboxparam;
    const value = this.M.getMsgBoxParam;
    if (value == null) {
      return;
    }
    const ipsdeuilogic = this.getParentPSModelObject(S._206) as IPSDEUILogic;
    if (ipsdeuilogic != null) {
      this.msgboxparam = ipsdeuilogic.findPSDEUILogicParam(value);
    }
    return this.msgboxparam;
  }

  get msgBoxType(): 'INFO' | 'QUESTION' | 'WARNING' | 'ERROR' | 'PROMPT' {
    return this.M.msgBoxType;
  }

  get showMode(): 'CENTER' {
    return this.M.showMode;
  }

  get title(): string {
    return this.M.title;
  }
  get cls(): string {
    return 'PSDEUIMsgBoxLogicImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._1f2) return true;
    return super.instanceof(cls);
  }
}
